<?
include_once(dirname(__FILE__)."/../table/admin.php");
include_once(dirname(__FILE__)."/../io/db.php");
class per_admin {
	public $table;

	function __construct() {
		$this->table = new admin(); 
	}

	function login($adminName,$adminPwd,$db) {
		return $db->selectCount($this->table,"adminName = '$adminName' and adminKey = '$adminPwd'");
	}

	function getInfo($AdminName,$db) {
		foreach($this->table->col as $k=>$v) {
			$v->value = null;
		}
		$this->table->col['adminName']->colValue = $AdminName;
		$rs = $db->select($this->table,$this->table->col['adminName']);
		return $rs[0];
	}
}